<?php
/**
 * @var string $directoryAsset
 * @var \common\models\db\User $user
 */
$user = Yii::$app->user->identity;
$menuList = $user->getAdminMenuTree();
?>

<aside class="main-sidebar">
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="<?= $user->avatar ?>" class="img-circle" alt="User Image"/>
            </div>
            <div class="pull-left info">
                <p><?=$user->getNickName() ?></p>
            </div>
        </div>

        <?= dmstr\widgets\Menu::widget(
            [
                'options' => ['class' => 'sidebar-menu tree', 'data-widget'=> 'tree'],
                'items' => $menuList,
            ]
        ) ?>

    </section>

</aside>
